package com.xinsmartsky.penmaji.NewGridView;

import android.view.View;

/**
 * Created by wangxiao on 15-12-25.
 */
public class Coordinate {
    private View view;
    private float x, y;
    private float length;
    private float startx, starty, endx, endy;

    public Coordinate(View view, float x, float y, float length) {
        this.view = view;
        this.x = x;
        this.y = y;
        this.length = length;
    }

    public float Rect_StartX() {
        int isx = (int) (x / length);
        startx = isx * length;
        return startx;
    }

    public float Rect_StartY() {
        int isy = (int) (y / length);
        starty = isy * length;
        return starty;
    }

    public float Rect_EndX() {
        endx = startx + length;
        return endx;
    }

    public float Rect_EndY() {
        endy = starty + length;
        return endy;
    }

}

